package com.iknight.portal.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONArray;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.iknight.portal.model.Student;
import com.iknight.portal.service.StudentService;

@RestController
@RequestMapping("/aa")
public class A {

	@Autowired
	private StudentService<Student> studentService;
	
	@GetMapping("/a")
	public Object testPrit( Map<String, Object> map,
			HttpServletRequest req, HttpServletResponse res) {

		System.out.println("-----------in controller------------");

		
		List<Student> list = studentService.selectAllStudent();
		
		
		return JSONArray.fromObject( list );
	}

}
